<html>
<head><meta charset="utf-8"><title>unused_braces false positives · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/unused_braces.20false.20positives.html">unused_braces false positives</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194724870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/unused_braces%20false%20positives/near/194724870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/unused_braces.20false.20positives.html#194724870">(Apr 20 2020 at 19:57)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/70814" title="https://github.com/rust-lang/rust/issues/70814">https://github.com/rust-lang/rust/issues/70814</a> seems to affect a decent amount of crates and should be fixed before<br>
beta IMO, which is on the 23 April.</p>
<p>I could try and fix this by not emitting these errors if the span is <code>DUMMY_SPAN</code>, which should fix the rustdoc issue, but we still have the problem when using quote in this case.</p>
<p>My initial theory was that checking if the surrounding block originates from a macro should fix this, as <code>quote!(#block_expr)</code> seems to use the actual source block, which means that checking if the inner block is from a macro expansion doesn't work (<a href="https://github.com/rust-lang/rust/blob/8ce3f840ae9b735a66531996c32330f24b877cb0/src/librustc_lint/unused.rs#L808" title="https://github.com/rust-lang/rust/blob/8ce3f840ae9b735a66531996c32330f24b877cb0/src/librustc_lint/unused.rs#L808">https://github.com/rust-lang/rust/blob/8ce3f840ae9b735a66531996c32330f24b877cb0/src/librustc_lint/unused.rs#L808</a>)<br>
This did not prevent the warnings though, so I don't know how to proceed here.</p>



<a name="194725218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/unused_braces%20false%20positives/near/194725218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/unused_braces.20false.20positives.html#194725218">(Apr 20 2020 at 20:00)</a>:</h4>
<p>We usually backport regression fixes to beta (provided the fix is small enough), so it's not terribly urgent</p>



<a name="194728684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/unused_braces%20false%20positives/near/194728684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/unused_braces.20false.20positives.html#194728684">(Apr 20 2020 at 20:30)</a>:</h4>
<p>Good to know <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span> still want to fix this and don't know how though <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>